# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php81-pecl-amqp
_extname=amqp
pkgver=1.11.0
pkgrel=0
pkgdesc="PHP 8.1 extension to communicate with any AMQP spec 0-9-1 compatible server - PECL"
url="https://pecl.php.net/package/amqp"
arch="all"
license="PHP-3.01"
depends="php81-common"
makedepends="php81-dev rabbitmq-c-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"

build() {
	phpize81
	./configure --prefix=/usr --with-php-config=php-config81
	make
}

check() {
	# Tests require running AMQP server, so basic check
	php81 -d extension="$builddir"/modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php81/conf.d
	mkdir -p $_confdir
	echo "extension=$_extname" > $_confdir/40_$_extname.ini
}

sha512sums="
0f0220fc2f1f9109640e096ab38a4bb06b2569a336b83f527d18dae2b8c21efaf383dade807ee5bb3dbf4447bc3548c15f38ac18155762fe7920ef8939bc0321  php-pecl-amqp-1.11.0.tgz
"
